export default class Component {

    constructor() {
        this.render();
    }

    render() {
        this.beforeCreate();
        this.create();
        this.afterCreate();
        this.initEvent();
    }

    refresh() {
        this.beforeUpdate();
        this.update();
        this.afterUpdate();
    }

    initEvent() {}

    dispose() {
        this.beforeDestory();
        this.destroy();
        this.afterDestory();
    }

    beforeCreate() {}
    create() {}
    afterCreate() {}

    beforeUpdate() {}
    update() {}
    afterUpdate() {}

    beforeDestory() {}
    destroy() {}
    afterDestory() {}
}